package com.woniu.controller;

import com.woniu.entity.Result;
import com.woniu.pojo.Receiver;
import com.woniu.service.IReceiverService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xie
 * @since 2022-10-12
 */
@RestController
@RequestMapping("/receiver")
@Api(tags = "收货地址管理")
public class ReceiverController extends BaseController{
    @Autowired
    private IReceiverService service;

    @GetMapping("/{memberId}")
    @ApiOperation("通过会员id查找")
    public Result queryByMemberId(@PathVariable String memberId){
        List<Receiver> receivers=service.queryByMemberId(memberId);
        return toDataResult(receivers);
    }

}
